{% extends "base.html" %}

{% block class %}comment{% endblock %}

{% block main %}
<h3>Preview your comment</h3>
<dl>
    {% load markup %}
    <form action="/comments/postfree/" method="post">
    {% if comment_form.has_errors %}
        <p><strong style="color: red;">Please correct the following errors.</strong></p>
    {% else %}
        <dd class="comment">
        {{ comment.comment|escape|urlizetrunc:"40"|markdown }}
        <p>Posted by <strong>{{ comment.person_name }}</strong></p>
        </dd>

        <p><input type="submit" name="post" value="Post public comment" /></p>

        <dt>Or edit it again</dt>
    {% endif %}

    {% if comment_form.person_name.errors %}
        {{ comment_form.person_name.html_error_list }}
    {% endif %}
    <p><label for="id_person_name">Your name:</label> {{ comment_form.person_name }}</p>

    {% if comment_form.comment.errors %}
        {{ comment_form.comment.html_error_list }}
    {% endif %}

    <p><label for="id_person_name">Comment:</label><br />{{ comment_form.comment }}</p>
    <input type="hidden" name="options" value="{{ options }}" />
    <input type="hidden" name="target" value="{{ target }}" />
    <input type="hidden" name="gonzo" value="{{ hash }}" />
    <p><input type="submit" name="preview" value="Preview revised comment" /></p>
    </form>
</dl>
{% endblock %}